﻿<div class="form-horizontal" style="margin:20px  auto auto 100px; " ms-controller="HDBMITEM">
    <div class="form-group">
        <label class="col-xs-3 control-label text-right"><span class="Required">*</span>联系人</label>
        <div class="col-xs-5">
            <input type="text" ms-duplex="modelData.BMLxr" class="form-control  szhl_require" placeholder="请输入联系人" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-3 control-label text-right "><span class="Required">*</span>联系电话</label>
        <div class="col-xs-5">
            <input type="text" ms-duplex="modelData.BMLxDH" class="form-control  szhl_Phone" placeholder="请输入联系电话" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-xs-3 control-label text-right "><span class="Required">*</span>报名人数</label>
        <div class="col-xs-5">
            <input type="text" ms-duplex="modelData.BMCount" class=" form-control szhl_Int" placeholder="请输入报名人数" />
        </div>
    </div>
</div>
<script>
    
    var tempmodel = avalon.define({
        $id: "HDBMITEM",
        HDBMID: ComFunJS.getQueryString("HDID"),
        iswf: false,//是否属于流程表单
        modelData: { "BMLxDH": "", "BMLxr": "", "BMCount": "", "HDID": "" },
        inittemp: function (strId) { 
            if (tempmodel.HDBMID) { 
                //编辑加载数据
                $.getJSON('/API/FTAPI.ashx?Action=GETHDBMITEMBYUSER', { P1: tempmodel.HDBMID }, function (resultData) { 
                    if (resultData.ErrorMsg == "" && resultData.Result != "") {
                        tempmodel.modelData = resultData.Result;
                    } else { 
                        tempmodel.modelData.HDID = tempmodel.HDBMID;
                    } 
                })
            }  
        },//初始化
        SaveData: function (btdom, piid) {
            var data = tempmodel.modelData.$model;
            var modelValue = JSON.stringify(data);
            $.post("/API/FTAPI.ashx?ACTION=ADDHDBMITEM", { P1: modelValue }, function (result) {
                var jsonresult = $.parseJSON(result)
                btdom.removeClass("disabled").find("i").hide();
                if ($.trim(jsonresult.ErrorMsg) == "") {
                    tempmodel.modelData = result.Result;
                    ComFunJS.winsuccessnew("操作成功");
                }
            });
        },
    });

</script>
